Resource Managers: durable metering for the CRE and other products#2158
Resource Managers: durable metering for the CRE and other products#2158patrickhuie19 wants to merge 9 commits into
Conversation
✅ API Diff Results -
|
ea6f574 to
e3e374b
Compare
| envMeteringEnvironment = "CL_METERING_ENVIRONMENT" | ||
| envMeteringZone = "CL_METERING_ZONE" | ||
| envMeteringNodeID = "CL_METERING_NODE_ID" | ||
|
|
There was a problem hiding this comment.
note to reader, DonID isn't here b/c a node can belong to many DONs; it is the responsibility of the loop to properly receive its DonID from Initialise in the standard cap interface (or for non-CRE use cases, elsewhere)
|
|
||
| "github.com/smartcontractkit/chainlink-common/pkg/chipingress" | ||
| "github.com/smartcontractkit/chainlink-common/pkg/logger" | ||
| "github.com/smartcontractkit/chainlink-common/pkg/services" |
There was a problem hiding this comment.
note to reader: changes made here instead of pkg/beholder as we are trying to leave beholder as is without accruing much more complexity, and durableemitter pkg is completely owned by foundations, so is a cleaner division of responsibility
cc @pkcll
df68849 to
147f64c
Compare
|
|
||
| // NewUtilizationString builds a Utilization from a pre-formatted numeric string | ||
| // value. | ||
| func NewUtilizationString(value string, fields UtilizationFields) *meteringpb.Utilization { |
There was a problem hiding this comment.
Does this one deserve the plain constructor name, since it is accepting the raw string?
There was a problem hiding this comment.
i.e. you are saying it should be called NewUtilization?
There was a problem hiding this comment.
Yeah with NewUtilizationInt or similar for the other one
| // (loop.EnvConfig), not the standard-capabilities boundary, so any LOOP plugin | ||
| // can populate the coarse metering rollup dimensions. Any field may be empty if | ||
| // the host did not provide it. | ||
| type DeploymentIdentity struct { |
There was a problem hiding this comment.
Where does this get used? Are the env vars meant to plug into this struct?
There was a problem hiding this comment.
yes, the env vars plug into, passed over to the loop via env. They should then be set on the ResourceManagers config so that they can be sourced into the emission of each event.
| } | ||
|
|
||
| // DonIdentifier captures DON-specific identity dimensions as one unit. | ||
| type DonIdentifier struct { |
There was a problem hiding this comment.
What is the difference between Identifier, Identity, and ID?
Resource Managers record and measure utilization of long lived resources that drawdown from unified account balances. i.e. trigger subscriptions drawing down from a CRE account balance.
Requires
https://github.com/smartcontractkit/chainlink-protos/pull/400/commits + smartcontractkit/chainlink-protos#419 (merged)
Supports
smartcontractkit/chainlink#22845